#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,r[N],a[N],e[N],minx,minx2,minn,minn2,ans;
bool flag=true;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
    }
    while(true){
        minn=N,minn2=N,minx=N,minx2=N;
        for(int i=1;i<=n;i++){
            if(r[i]<minn&&e[i]==0){
                minn=r[i];
                minx=i;
            }
        }
        for(int i=1;i<=n;i++){
            if(r[i]<minn2&&r[i]>minn&&e[i]==0&&a[i]==0){
                minn2=r[i];
                minx2=i;
            }
        }
        if(minn<N&&minx<N&&minn2<N&&minx2<N){
            e[minx]=1;
            a[minx]=1;
            a[minx2]=1;
        }
        else break;

    }
    for(int i=1;i<=n;i++){
        if(e[i]==0)ans++;
    }
    cout<<ans<<endl;
    return 0;
}
